#!/bin/bash 

ARR=(6 8 4 1 5 9 7 2 10 3)
len=${#ARR[@]}
for((i=0;i<$len;i++))
do
	for((j=0;j<$(($len-1-i));j++))
	do
		if [ "${ARR[$j]}" -gt "${ARR[$(($j+1))]}" ]
		then
			temp=${ARR[$j]}
			ARR[$j]=${ARR[$(($j+1))]}
			ARR[$(($j+1))]=$temp
		fi
	done
done

for i in ${ARR[@]}
do
	echo -n "$i "
done
echo ""
